import cv2
import numpy as np

# 读取图像
image = cv2.imread('../temp/image.jpg')
if image is None:
    print('Cannot read image file')
    exit(-1)

# 进行均值滤波，卷积核大小为3x3
smoothed = cv2.blur(image, (3, 3))

# 显示原始图像和平滑后的图像
cv2.namedWindow('Original Image', cv2.WINDOW_NORMAL)
cv2.namedWindow('Smoothed Image', cv2.WINDOW_NORMAL)
cv2.imshow('Original Image', image)
cv2.imshow('Smoothed Image', smoothed)

cv2.waitKey(0)
cv2.destroyAllWindows()